//物流管理-物流列表-配置文件
App.util.ns('Admin.Logistics.Logistics');
Admin.Logistics.Logistics.Conf = {
    columns: [
        {name: '订单名称', value: function(item){
            return item.orders ? ('ID：'+item.orders.id+'-'+item.orders.order_name) : '-- --';
        }},
        // {name: '供应商', width: '150px', value: function(item){
        //     return item.supplier ? item.supplier.name : '-- --';
        // }},
        {name: '用户', width: '150px', value: function(item){
            return item.user ? item.user.nickname : '-- --';
        }},
        {name: '快递公司', width: '100px', value: function(item){
            return item.delivers ? item.delivers.name : '-- --';
        }},
        {name: '快递编码', width: '100px', value: function(item){
            return item.delivers ? item.delivers.code : '-- --';
        }},
        {name: '运单号', width: '100px',value: 'deliver_no'},
        {name: '类型', width: '90px',value: function(item){
            switch (item.type+'') {
                case '0':
                    return '寄出';
                case '1':
                    return '用户寄回';
                case '2':
                    return '再次寄出';
            }
        }},
        {name: '状态', width: '90px',value: function(item){
            switch (item.status+'') {
                case '-1':
                    return '待查询';
                case '0':
                    return '查询异常';
                case '1':
                    return '暂无记录';
                case '2':
                    return '在途中';
                case '3':
                    return '派送中';
                case '4':
                    return '已签收';
                case '5':
                    return '用户拒签';
                case '6':
                    return '疑难件';
                case '7':
                    return '无效单';
                case '8':
                    return '超时单';
                case '9':
                    return '签收失败';
                case '10':
                    return '退回';
            }
        }},
        {name: '创建日期', width: '80px', value: function(item){
            return App.util.formator.date(item.created_at);
        }}
    ],
    form: [
        {type: 'hidden', name: 'id'},
        {type: 'chosen', name: 'order_id', title: '订单名称',
            items: App.models.get('orders-all'),
            item_key: 'id',
            item_name: 'order_name',
            value_key: 'id',
            rule:{
                type: 'num',
                range: [1, 10]
            }
        },
        {type: 'input', name: 'deliver_code', title: '快递编码', required: true, maxLength: 40, rule: {
            type: 'str',
            range: [1, 40]
        }},
        {type: 'input', name: 'deliver_no', title: '运单号', required: true, maxLength: 40, rule: {
            type: 'str',
            range: [1, 40]
        }},

        {type: 'textarea', name: 'record_json', title: '物流信息'}
    ]
};